from flask import render_template, request, jsonify, Blueprint
import service.address
from util.request_helper import get_parameter

index = Blueprint('index', __name__)


@index.route('/')
def index_page():
    return render_template('index.html')


@index.route('/find_nearby_address')
def search_address():
    address = get_parameter(request, 'address')
    return jsonify(service.address.request_address(address))
